package cn.itcast.bos.quartz;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import cn.itcast.bos.service.PromotionService;

public class PromotionJob implements Job {
	@Autowired
	private PromotionService promotionService;
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		System.out.println("活动处理程序运行");
		//定时执行该代码,到数据库中查询当前日期是否大于过期日期,并对status字段进行修改
		promotionService.updateStatus(new Date());
	}

}
